import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/widgets.dart';
import 'package:hayll_app_village_master/hayll/village_manager/device/device_register_page/bean/device_vendor_response.dart';
import 'package:hayll_app_village_master/hayll/village_manager/home/village_grid_component/bean/village_grid_response.dart';

class DeviceRegisterState implements Cloneable<DeviceRegisterState> {
  VillageBuildGridResult build;
  VillageUnitGridResult unit;
  int villageId = 0;
  List<DeviceVendorResult> vendorList = List();
  int selectedVendorId = -1;
  var nameController = TextEditingController();
  var deviceNoController = TextEditingController();
  @override
  DeviceRegisterState clone() {
    return DeviceRegisterState()
      ..villageId = villageId
      ..build = build
      ..unit = unit
      ..vendorList = vendorList
      ..selectedVendorId = selectedVendorId
      ..nameController = nameController
      ..deviceNoController = deviceNoController;
  }
}

DeviceRegisterState initState(Map<String, dynamic> args) {
  return DeviceRegisterState()
    ..villageId = args['villageId']
    ..build = args['build']
    ..unit = args['unit'];
}
